﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YT_TZZB.aspx.cs" Inherits="Xiaov.SmartWeb.Application.StatisticsReport.YT_TZZB" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>投资总表</title>
    <script type="text/javascript" src="../../SupCan/binary/dynaload.js?60"></script>
    <script type="text/javascript" language="javascript">
        function OnReady(id) {
            var ddlnf = document.getElementById("ddl_Year");
            var nf = ddlnf.options[ddlnf.selectedIndex].value;   //获取年份
            var ddlyf = document.getElementById("ddl_Month");
            var yf = ddlyf.options[ddlyf.selectedIndex].value;   //获取月份
            var dwbm = "HB";
            if (id == "AF") {
                document.AF.func("Build", "YT_TZZB.xml");
                document.AF.func("Load", "YT_TZZBData.aspx?nf=" + escape(nf) + "&yf=" + escape(yf) + "&dwbm=" + escape(dwbm));
                document.AF.func("Expand", "");
                for (var row = document.AF.func("GetNextValidRow", ""); row != ""; row = document.AF.func("GetNextValidRow", row)) {
                    var sx = document.AF.func("GetCellData", row + "\r\nxmgcid_lb");
                    if (sx == "项目类别") {
                        document.AF.func("SetRowBackColor", row + "\r\n#D3EEF7");
                    }
                    else if (sx == "工程类别") {
                        document.AF.func("SetRowBackColor", row + "\r\n#E0ECFF");
                    }
                }
            }
        }

        function OnEvent(id, Event, p1, p2, p3, p4) {
            if (id == "AF") {
                if (Event == "MenuBeforePopup") {
                    document.AF.func("DisableMenu", "import,selectCol");
                }
            }
        }

        function query() {
            var ddlnf = document.getElementById("ddl_Year");
            var nf = ddlnf.options[ddlnf.selectedIndex].value;   //获取年份
            var ddlyf = document.getElementById("ddl_Month");
            var yf = ddlyf.options[ddlyf.selectedIndex].value;   //获取月份
            var dwbm = "HB";
            form1.AF.func("Load", "YT_TZZBData.aspx?nf=" + escape(nf) + "&yf=" + escape(yf) + "&dwbm=" + escape(dwbm));
        }      

        function saveData() {
            var saveData = document.AF.func("GetChangedXml", "level=1;isValidateKey=false");
            var hd = document.getElementById('<%=HDData.ClientID %>');
            hd.value = saveData;
            return true;
        }  
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:HiddenField ID="HDData" runat="server"></asp:HiddenField>
    </div>
    <div class="tools">
        <asp:DropDownList ID="ddl_Owner" runat="server" Visible="false">
        </asp:DropDownList>
        <asp:DropDownList ID="ddl_Year" runat="server">
        </asp:DropDownList>
        <asp:DropDownList ID="ddl_Month" runat="server">
        </asp:DropDownList>
        <input type="button" value="查询" onclick="query();" />
        <asp:Button ID="btn_Save" runat="server" Text="保存" OnClick="btn_Save_Click" OnClientClick="return saveData();" />
        <asp:Button ID="btn_Clear" runat="server" Text="清空" OnClick="btn_Clear_Click" />
        <asp:Button ID="btnGenData" runat="server" Text="生成数据" OnClick="btnGenData_Click" />
    </div>
    <div style="height: 5px; width: 99%">
    </div>
    <table style="height: 95%; width: 99%">
        <tr>
            <td>
                <script language="javascript" type="text/javascript">
                    insertTreeList('AF', '') 
                </script>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
